home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / Miracle C Compiler / miricleC compiler.msi / Instal01.cab / _5A63258006614D5F94BF8EE04370112F < prev    next >
Encoding:
Text File  |  1999-02-27  |  428 b   |  19 lines

  1. #include <stdio.h>
  2.  
  3. /* print Fahrenheit-celcius table
  4.     for fahr = 0, 20 , ..., 300 */
  5. main()
  6. {
  7.     float fahr, celcius;
  8.     int lower , upper, step;
  9.     lower = 0;        /* lower limit of temperature table */
  10.     upper = 300;    /* upper limit*/
  11.     step = 20;         /* step size*/
  12.  
  13.     fahr = lower ;
  14.     while     (fahr <= (float)upper) {
  15.         celcius = (5.0/9.0) * (fahr-32.0);
  16.         printf("%3.0f %6.1f\n", fahr, celcius);
  17.         fahr = fahr + step;
  18.     }
  19. }